<%layout("/common/_layout.html"){%>
<%#ajax userTable:{%>
<div class="am-cf am-padding" style="padding:1rem 1.6rem 1.6rem 1rem;margin:0px;"> <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
  <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">运营管理</strong> / <small>泛店员注册管理</small></div>
</div>
 <div class="am-g">
    <div class="am-u-sm-12">
        <form class="am-form" id="listForm" action="${base}/spreadMemberReg/list" method="post">
        <input type="hidden" id="keywords" name="keywords" value='${keywords!""}' />
        <table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
          <tbody>
            <tr>
              <th class="am-text-middle">姓名</th>
              <td>
              <div class="am-u-sm-10">
                  <input type="text" id="name" class="am-form-field am-input-sm" value="${name!}" maxlength="60" />
                </div>
              </td>
        	  <th class="am-text-middle">发展人姓名</th>
	          <td>
	            <div class="am-u-sm-10">
	              <input type="text" id="parent_name" class="am-form-field am-input-sm" value="${parent_name!}" maxlength="60" />
	            </div>
	          </td>
            </tr>
            <tr>
              <th class="am-text-middle">工号</th>
              <td>
              <div class="am-u-sm-10">
                  <input type="text" id="emp_code" class="am-form-field am-input-sm" value="${emp_code!}" maxlength="60" />
                </div>
              </td>
        	  <th class="am-text-middle">发展人工号</th>
	          <td>
	            <div class="am-u-sm-10">
	              <input type="text" id="parent_emp_code" class="am-form-field am-input-sm" value="${parent_emp_code!}" maxlength="60" />
	            </div>
	          </td>
            </tr>
            <tr>
                <td colspan="4">
                  <div align='right'>
                    <button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary" id="submit-btn">搜索</button>
                  </div>
                </td>
            </tr>
          </tbody>
        </table>
      </form>
    </div>
 </div>
  <div class="am-g">
    <div class="am-u-sm-12">
    <div class="am-scrollable-horizontal">
      <table class="am-table am-table-striped am-table-hover table-main">
        <thead>
          <tr class="am-text-nowrap">
             <!--<th class="table-check"><input type="checkbox" id="allCheck"></th>-->
             <th class="table-title">姓名</th>
             <th class="table-title">电话</th>
             <th class="table-title">工号</th>
             <th class="table-title">发展人姓名</th>
             <th class="table-title">发展人工号</th>
             <th class="table-title">审核状态</th>
             <th class="table-title">审核时间</th>
             <th class="table-title">注册时间</th>
             <th class="table-title">开户名称</th>
             <th class="table-title">银行卡号</th>
             <th class="table-title">开户行</th>
             <th class="table-title">开户地</th>
             <th class="table-title">支行信息</th>
             <th class="table-title">银行类型代码</th>
           
          </tr>
        </thead>
        <tbody>
       <%for(list in pager.list!){%>
         <tr>
           <!--<td><input type="checkbox" <%{%>name="ids" value="${list.id}"<%}%> /></td>-->  
           <td>${list.my_name!}</td>
           <td>${list.phone_number!}</td>
           <td>${list.my_emp_code!}</td>
           <td>${list.parent_name!}</td>
           <td>${list.parent_emp_code!}</td>
           <td><%if(list.ratify == 0) {%>
                审核中
           <%}else if(list.ratify == 1) {%>
                审核通过
           <%}else if(list.ratify == 2) {%>
                审核未通过
           <%}else{%>
                未知
           <%}%>
           </td>
           <td>${list.ratify_time, dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
           <td>${list.spread_reg_time, dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
           <td>${list.account_name!}</td>
           <td>${list.card_number!}</td>
           <td>${list.regist_bank!}</td>
           <td>${list.regist_area!}</td>
           <td>${list.subbranch!}</td>
           <td>${list.bank_type!}</td>
         </tr>
       <%}%> 
     </tbody>
     </table>
     </div>
      <div class="am-cf">
         <!-- 分页 -->
         <%if (pager.list.~size > 0){%>
             <div class="am-fr">
                 <% include("/admin/common_pager.tpl"){}%>
             </div>
         <%}else{%>
             <div class="am-kai">
               <h3>没有找到任何记录!</h3>
             </div>
         <%}%>
      </div>
    
    </div>
  </div>

<script type="text/javascript">
    $(function(){
      var keywordsObj = {};
      $("#submit-btn").on("click",function(){
        if($("#name").val())
          keywordsObj.name = $("#name").val();
        if($("#parent_name").val())
          keywordsObj.parent_name = $("#parent_name").val();
        if($("#emp_code").val())
          keywordsObj.emp_code = $("#emp_code").val();
        if($("#parent_emp_code").val())
          keywordsObj.parent_emp_code = $("#parent_emp_code").val();

        var keywords = "";
        if(!$.isEmptyObject(keywordsObj)){
          keywords = JSON.stringify(keywordsObj);
        }
        console.log("keywords = "+ keywords);

        $("#keywords").val(keywords);
        $("#listForm").submit();
      });
    });
  </script>
  <%}%>
<%}%>
